import wx

class MyFrame(wx.Frame):
    def __init__(self):
        # 创建窗体
        super().__init__(None, title = '复选框样例', size = (600, 800))
        panel = wx.Panel(self)

        cb1 = wx.CheckBox(panel, label = 'Java')
        cb1.SetValue(True)  # 打勾
        cb2 = wx.CheckBox(panel, label = 'Python')
        cb3 = wx.CheckBox(panel, label = 'C++')
        hbox = wx.BoxSizer(wx.HORIZONTAL)
        hbox.Add(cb1)
        hbox.Add(cb2)
        hbox.Add(cb3)
        panel.SetSizer(hbox)
        self.Bind(wx.EVT_CHECKBOX, self.checkbox_click)

    def checkbox_click(self, event):
        obj = event.GetEventObject()  # 当前勾选/去勾选的那个选框
        print(f'选中,选项：{obj.GetLabel()}，状态：{obj.IsChecked()}')

app = wx.App()
window = MyFrame()
window.Show()
app.MainLoop()